package com.easychat.entity.enums;

/**
 * @Author Dongdong
 * @注释 联系人状态枚举
 */

public enum UserContactStatusEnum {

    NOT_FRIEND(0,"非好友"),
    FRIEND(1,"好友"),
    DELETE(2,"删除对方"),
    DELETE_BE(3,"被对方删除"),
    BLACK(4,"拉黑对方"),
    BLACK_BE(5,"被对方拉黑"),
    BLACK_BE_FIRST(6,"首次被拉黑");
    private Integer code;
    private String desc;
    UserContactStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static UserContactStatusEnum getByStatus(Integer status) {
        for (UserContactStatusEnum userContactStatus : UserContactStatusEnum.values()) {
            if(userContactStatus.getCode().equals(status)){
                return userContactStatus;
            }
        }

            return null;

    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
